package com.dream.banana.dubbo.echo;

import java.util.Set;

/**
 * 躲了一辈子雨，雨会不会很难过。
 * </p>
 * Created by zhumenglong on 2017/5/28.
 */
public interface IDubboReferenceMonitorService {
    int getReferenceCount();

    Set<String> getAllReferenceNames();

    Set<IDubboReferenceMonitorService.ReferenceStatusMonitor> checkAllDubboReferences();

    public static class ReferenceStatusMonitor {
        private final String beanName;
        private final IDubboReferenceMonitorService.ReferenceStatusMonitor.RefStatusEnum status;

        public ReferenceStatusMonitor(String beanName,
                                      IDubboReferenceMonitorService.ReferenceStatusMonitor.RefStatusEnum status) {
            this.beanName = beanName;
            this.status = status;
        }

        public String getBeanName() {
            return this.beanName;
        }

        public IDubboReferenceMonitorService.ReferenceStatusMonitor.RefStatusEnum getStatus() {
            return this.status;
        }

        public static enum RefStatusEnum {
            NORMAL, DISABLED;
        }
    }
}
